ScrollPaneHeader = fgui.extension_class(GComponent)

function ScrollPaneHeader:ctor()
	self._c1 = self:GetController("c1");
	self.onSizeChanged:Add(self.OnSizeChanged, self);
end

function ScrollPaneHeader:OnSizeChanged()
	-- body
	if (self._c1.selectedIndex == 2 or self._c1.selectedIndex == 3) then
		return;
	end

	if (self.height > self.sourceHeight) then
		self._c1.selectedIndex = 1;
	else
		self._c1.selectedIndex = 0;
	end
end

function ScrollPaneHeader:ReadyToRefresh()
	-- body
	return self._c1.selectedIndex == 1;
end

function ScrollPaneHeader:SetRefreshStatus(value)
	-- body
	self._c1.selectedIndex = value;
end